<?php namespace Siyuanliu\Filmcms\Updates;

use Schema;
use October\Rain\Database\Schema\Blueprint;
use October\Rain\Database\Updates\Migration;

class CreateFilmsTable extends Migration
{
    public function up()
    {
        Schema::create('siyuanliu_filmcms_films', function(Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->string('title',255);
            $table->string('description',255)->nullable();;
            $table->integer('want')->unsigned()->nullable();
            $table->integer('watched')->unsigned()->nullable();
            $table->integer('scores')->unsigned()->nullable();
            $table->integer('scoresNum')->unsigned()->nullable();
            $table->tinyInteger('is_show');
            $table->json('resources')->nullable();
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::drop('siyuanliu_filmcms_films');
    }
}
